Deadlocks pt 2

 

use ReportBuilderTraining

-- can't read from Address while tranasction open in other process
select * from Address where StudentId=1

-- only the "page" is locked, other pages may be availble
select * from Address where addressid = 10000

-- can do a dirty read
select * from Address with (nolock) where StudentId=1

-- initiate a deadlock

Begin Transaction

-- #2

update Phone
	set Local='609-555-9999'
	where StudentId=1


-- #4

update Address
	set Street1 = 'W725 Haeussinger Rd'
	where StudentId=1